package com.wf.classRoomTest.run;

import java.util.Vector;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author mpk
 * @since 2024/6/8 14:23:57
 */
public class ThreadDemo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        ReentrantLock lock = new ReentrantLock(true);

        MyCallable myCallable = new MyCallable();

        FutureTask<Integer> task = new FutureTask<>(myCallable);

        Thread thread = new Thread(task);

        thread.start();

        System.out.println(task.get());




    }


}
